﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COFE.Core.Logger
{
    public class EventListener<T> : IEventListener<T>
       where T : EventArgs
    {
        public EventListener(Action<object, T> onDispatch)
        {
            if (onDispatch == null)
                throw new ArgumentException();
            _dispatchEvent = onDispatch;
        }

        private Action<object, T> _dispatchEvent;

        public void DispatchEvent(object sender, T args)
        {
            _dispatchEvent(sender, args);
        }
    }
}
